

#ifndef xmixer_hpp
#define xmixer_hpp

#include <netinet/in.h>
#include <string>

#include "xrtc_endpoint.h"

#define MIX_TIMER_INTERVAL 20

typedef struct xmixer_st* xmixer_t;

xmixer_t xmixer_create(const char* id, int is_loopback, bool debug_enabled, std::string& addr);

void xmixer_delete(xmixer_t mixer);

int xmixer_add_rtc(xmixer_t mixer, rtc_endpoint_t rtc);

// xmixer_maybe_mix_frame
// returns
//   - false if it has no stream, could be closed
//   - true if otherwise
bool xmixer_maybe_mix_frame(xmixer_t mixer);

int xmixer_set_tlv_filename(xmixer_t mixer, const std::string& tlv_pathname);

void xmixer_get_tlv_filename(xmixer_t mixer, std::string& tlv_pathname);

const char* xmixer_get_id(xmixer_t);

int xmixer_join_remote(xmixer_t mixer, sockaddr_in sa);

#endif /* xmixer_hpp */
